package com.usian.admin.controller;

import com.usian.admin.service.UserLoginService;
import com.usian.apis.admin.admin.LoginControllerApi;
import com.usian.model.admin.dtos.AdUserDto;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logn")
public class UserLoginController implements LoginControllerApi {
    @Autowired
    private UserLoginService userLoginService ;

    @Override
    @PostMapping("/in")
    public ResponseResult login(@RequestBody AdUserDto dto){
        return userLoginService.login(dto);
    }

//    public static void main(String[] args) {
//
//        String salt = "000000";
//        String pswd = "12345"+salt;
//
//        String saltPswd = DigestUtils.md5DigestAsHex(pswd.getBytes());
//        System.out.println(saltPswd);
//    }
}
